package com.boge.ai;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;

public class Main {
    public static void main(String[] args) {
        String apiKey = System.getenv("AI-BAILIAN-API-KEY");
        OpenAiChatModel model = OpenAiChatModel.builder()
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .apiKey(apiKey)
                .modelName("qwen-plus")
                .logRequests(true)
                .logResponses(true)
                .build();

        String content = model.chat("你是谁?你能介绍下你自己吗?");
        System.out.println(content);
    }
}